<script setup lang="ts">
import { Handle, Position } from '@vue-flow/core';

interface NodeData {
  label: string;
}

defineProps<{
  id: string;
  data: NodeData;
}>();
</script>

<template>
  <div class="end-node">
    <div class="node-content">
      <div class="node-label">
        {{ data.label }}
      </div>
    </div>

    <!-- 只有顶部输入连接点 -->
    <Handle type="target" :position="Position.Top" class="handle" />
  </div>
</template>

<style scoped>
.end-node {
  border-radius: 50%;
  background: #3b82f6;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.25);
  transition: all 0.2s;
  position: relative;
}

.end-node:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.node-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
}

.node-label {
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.handle {
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border: 2px solid white;
  border-radius: 50%;
}
</style>
